package cn.libinal.scloud.base.controller;

import cn.libinal.scloud.base.common.web.ResultJson;
import cn.libinal.scloud.base.entity.Menu;
import cn.libinal.scloud.base.service.MenuService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author libinal
 * created at 2018/11/6 20:53
 */
@RestController
@RequestMapping("menu")
public class MenuController {
    private final MenuService menuService;

    public MenuController(MenuService menuService) {
        this.menuService = menuService;
    }

    @PostMapping(name = "新增菜单", path = "create")
    public ResultJson<Menu> create(@RequestBody Menu menu) {
        return ResultJson.success(menuService.create(menu));
    }
}
